<template>
    <div id="b64">
        <el-input
                type="textarea"
                :rows="10"
                placeholder="请输入要base64编码的文本"
                v-model="bm_textarea">
        </el-input>
        <br><br><br>
        <el-button type="primary" @click="bm">↓编码↓</el-button>
        <el-button type="primary" @click="jm">↑解码↑</el-button>
        <br><br><br>
        <el-input
                class="text"
                type="textarea"
                :rows="10"
                placeholder="请输入要base64解码的文本"
                v-model="jm_textarea">
        </el-input>
    </div>



</template>

<script>
    export default {
        name: "b64",
        methods:{
            bm:function(){

                var _this=this;
                this.axios.get('/api/bm/',{params:{'bm':this.bm_textarea}}).then(function(response){
                    _this.jm_textarea = response.data.msg
                })
            },
            jm:function(){
                var _this=this;
                this.axios.get('/api/jm/',{params:{'jm':this.jm_textarea}}).then(function(response){
                    _this.bm_textarea = response.data.msg
                })
            }
        },
        data:function(){
            return{
                bm_textarea: '',
                jm_textarea:''
            }
        }
    }
</script>

<style scoped>
    #b64{
        text-align: center;
        margin: 10px auto;
        width: 1000px;
    }
</style>